﻿using Coldairarrow.Entity.View;
using Coldairarrow.Util;
using System.Collections.Generic;
using System.Threading.Tasks;

namespace Coldairarrow.Business.View
{
    public partial interface IView_Base_DepartmentBusiness
    {
        Task<List<ViewBase_DepartmentTreeDTO>> GetTreeDataListAsync(ViewDepartmentsTreeInputDTO input);
        Task<List<ViewBase_DepartmentTreeDTO>> GetTreeTypeDataListAsyncs(ViewDepartmentsTreeInputDTO input);
        /// <summary>
        /// 查找部门下子级部门
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        Task<List<ViewBase_DepartmentTreeDTO>> GetTreeTypeDataListBumen(ViewDepartmentsTreeInputDTO input);
        Task<List<Deptitemdto>> GetItemDeptid(ViewDepartmentsTreeInputDTO input);
        Task<List<Deptitemdto>> GetItemDeptidvalueid(ViewDepartmentsTreeInputDTO input);
        Task<List<Deptitemdto>> GetItemDeptidWorkShop(ViewDepartmentsTreeInputDTO input);
        Task<View_Base_Department> GetTheDataAsync(string id);
        Task AddDataAsync(View_Base_Department data);
        Task UpdateDataAsync(View_Base_Department data);
        Task DeleteDataAsync(List<string> ids);


        Task<View_Base_Department> GetDeptDataAsync(string deptid);
        /// <summary>
        /// 根据当前车间寻找上级工厂
        /// </summary>
        /// <param name="deptid"></param>
        /// <returns></returns>
        Task<View_Base_Department> GetDeptDataAsyncWorkShop(string deptid);

        /// <summary>
        /// 获取登录人工厂下的所有部门信息
        /// </summary>
        /// <returns></returns>
        Task<List<ViewBase_DepartmentTreeDTO>> GetDeptListAsync();

    }
    public class ViewDepartmentsTreeInputDTO
    {
        public string parentId { get; set; }
        public int? Type { get; set; }

     
    }

    public class ViewBase_DepartmentTreeDTO : TreeModel
    {
        public object children { get => Children; }
        public string title { get => Text; }
        public string value { get => Id; }
        public string key { get => Id; }
        public string TypeName { get; set; }

      
    }

    public class Deptitemdto
    {
        public string Id { get; set; }
        public string Name { get; set; }
        public string parentId { get; set; }
    }

}